﻿namespace Sustainalytics.CarbonData.BussinesLogic
{

    public class ProcessResult
    {
        public bool Success { get; set; }
        public string Details { get; set; }

    }

    public class ValidationResult
    {
        public bool Success { get { return CompaniesInputSuccess || FrameworkSuccess; } }
        public InputValidationErrors GeneralError { get; set; }
        
        public string Details 
        {
            get 
            {
                if (string.IsNullOrEmpty(FrameworkDetails))
                    FrameworkDetails = "none";

                if (string.IsNullOrEmpty(CompaniesInputDetails))
                    CompaniesInputDetails = "none";

                return "Please see details for a list of items that were not completed:\n"+
                       "Framework issues:\n " + FrameworkDetails + "\n" +
                       "Companies issues:\n" + CompaniesInputDetails + "\n";
            } 
        }
        
        //framework
        public bool FrameworkSuccess { get; set; }         
        public string FrameworkDetails { get; set; }
        public InputValidationErrors FrameworkError { get; set; }


        //assessments
        public bool CompaniesInputSuccess { get; set; }
        public string CompaniesInputDetails { get; set; }
        public InputValidationErrors CompaniesInputError { get; set; }

    }
}
